package x.trident.core.micro.api.exception;

import cn.hutool.core.util.StrUtil;
import x.trident.core.micro.api.constants.MicroConstants;
import x.trident.core.exception.AbstractExceptionEnum;
import x.trident.core.exception.base.ServiceException;

/**
 * 微服务模块的异常
 *
 * @author Seven
 * @date 2021/5/10 10:19
 */
public class MicroException extends ServiceException {

    public MicroException(AbstractExceptionEnum exception) {
        super(MicroConstants.MICRO_MODULE_NAME, exception);
    }

    public MicroException(AbstractExceptionEnum exception, Object... params) {
        super(MicroConstants.MICRO_MODULE_NAME, exception.getErrorCode(), StrUtil.format(exception.getUserTip(), params));
    }

}
